<?php

    include "./sql.php";

    // 区别搜索两张表
    $details = $_REQUEST['details'];
    $detailimg = $_REQUEST['detailimg'];

    if($details){
        $d = queryOne("SELECT * FROM details WHERE goodsid='".$details."'");
    };
    if($detailimg){
        $d = queryOne("SELECT * FROM detailimg WHERE goodsid='".$detailimg."'");
    };

    if($d){
        echo(json_encode($d));  
    }else{
        $backData = array("code"=>1,"errMsg"=>"商品ID不存在","sucMsg"=>"");
        die(json_encode($backData));
    };

?>